#注册表单页面
from selenium.webdriver.common.by import By

from utils.page_base import PageBase

class PageRegForm(PageBase):
    url="/webzdh/form.html"
    loc_zanhao=By.ID,"username"
    loc_pwd=By.ID,"pwd"
    loc_sex="sex"
    loc_guoji="guoji"
    loc_aihao="aihao"
    loc_degree="degree"
    loc_jiesao=By.ID,"jiesao"
    loc_zaopian=By.ID,"zaopian"
    loc_birthday=By.ID,"birthday"



    def __init__(self,driver,base_url):
        PageBase.__init__(self,driver,base_url)

    def openUrl(self):
        self.open(PageRegForm.url)

    def input_zanhao(self,data):
        self.input(PageRegForm.loc_zanhao,data)

    def input_pwd(self,data):
        self.input(PageRegForm.loc_pwd,data)

    def selectSex(self,sex):#"M"
        self.selectRaidoOption(PageRegForm.loc_sex,sex)

    def selectGuoji(self,guoji):#"zonguo"
        self.selectRaidoOption(PageRegForm.loc_guoji,guoji)

    def selectAihao(self,aihao):#"dalanqiu,tizuqiu"
        self.selectCheckBoxOptions(PageRegForm.loc_aihao,aihao)

    def selectDegree(self,degree):#"硕士"
        self.selectSelectOption(PageRegForm.loc_degree,data=degree)

    def input_jiesao(self,data):
        self.input(PageRegForm.loc_jiesao,data)

    def uploadZaopian(self,zaopianFilePath):#"C:/A/1.png,C:/A/2.pmg" ""
        self.uploadFiles2(PageRegForm.loc_zaopian,zaopianFilePath)

    def input_birthday(self,birthday):#“2005-06-05”
        self.date_input2(PageRegForm.loc_birthday,birthday)




